from rest_framework.decorators import api_view, authentication_classes, permission_classes
from libs.simple_responses import api_success
from libs.auth.openapi import openapi_auth

from system.services import organization_service


@api_view(['GET'])
@authentication_classes([])
@permission_classes([])
@openapi_auth()
def info(request):
    instance = organization_service.get()
    data = {
        'name': instance.name,
        'contact': instance.contact
    }
    return api_success(data=data)
